#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <string.h>

struct msgbuf{
	long type;
	char text[100];
};
int main(void)
{
	int id=msgget(1234,0);

	struct msgbuf sb;

	printf("channel: ");
	scanf("%d",&sb.type);
	printf("text: ");
	scanf("%s",sb.text);

	msgsnd(id,&sb,strlen(sb.text),0);
}
